package com.wly.ui.panel
{
	import com.wly.event.EventCodes;
	import com.wly.event.EventManager;
	import com.wly.ui.scene.SceneDefine;
	
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	public class StartPanel extends Sprite
	{
		private var _btnStart:SimpleButton;
		private var _btnShop:SimpleButton;
		private var _btnExit:SimpleButton;
		private var _mcSetting:SettingPanel;
		
		public function StartPanel()
		{
			super();
			initChilds();
		}
		
		private function initChilds():void
		{
			_btnStart = getChildByName("btnStart") as SimpleButton;
			_btnShop = getChildByName("btnShop") as SimpleButton;
			_btnExit = getChildByName("btnExit") as SimpleButton;
			_mcSetting = getChildByName("mcSetting") as SettingPanel;
			
			_btnStart.addEventListener(MouseEvent.CLICK, onStart);
			_btnShop.addEventListener(MouseEvent.CLICK, onShop);
			_btnExit.addEventListener(MouseEvent.CLICK, onExit);
		}
		
		private function onStart(e:MouseEvent):void
		{
			EventManager.getInstance().dispatchEvent(EventCodes.EVENT_SCENE_UPDATE, SceneDefine.SCENE_GAME);
		}
		
		private function onShop(e:MouseEvent):void
		{
			
		}
		
		private function onExit(e:MouseEvent):void
		{
			
		}
	}
}